<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:r2mlv="http://www.rewerse.net/I1/2006/R2ML/R2MLV" targetNamespace="http://www.rewerse.net/I1/2006/R2ML/R2MLV" elementFormDefault="qualified" attributeFormDefault="qualified" xml:lang="en">
 <xs:element name="Vocabulary" type="r2mlv:Vocabulary"/>
 <xs:element name="VocabularyEntry" type="r2mlv:VocabularyEntry" abstract="true"/>
 <xs:element name="Predicate" type="r2mlv:Predicate" abstract="true" substitutionGroup="r2mlv:VocabularyEntry"/>
 <xs:element name="Property" type="r2mlv:Property" substitutionGroup="r2mlv:Predicate"/>
 <xs:element name="Type" type="r2mlv:Type" abstract="true" substitutionGroup="r2mlv:VocabularyEntry"/>
 <xs:element name="DatatypePredicate" type="r2mlv:DatatypePredicate" substitutionGroup="r2mlv:Predicate"/>
 <xs:element name="Attribute" type="r2mlv:Attribute" substitutionGroup="r2mlv:Property"/>
 <xs:element name="ReferenceProperty" type="r2mlv:ReferenceProperty" substitutionGroup="r2mlv:Property"/>
 <xs:element name="Class" type="r2mlv:Class" substitutionGroup="r2mlv:Type"/>
 <xs:element name="Datatype" type="r2mlv:Datatype" substitutionGroup="r2mlv:Type"/>
 <xs:element name="ObjectName" type="r2mlv:ObjectName" substitutionGroup="r2mlv:VocabularyEntry"/>
 <xs:element name="GenericEntityName" type="r2mlv:GenericEntityName" substitutionGroup="r2mlv:VocabularyEntry"/>
 <xs:element name="domain" type="r2mlv:domain"/>
 <xs:element name="range" type="r2mlv:range"/>
 <xs:element name="argumentsType" type="r2mlv:argumentsType"/>
 <xs:element name="ap" type="r2mlv:ap"/>
 <!--
Vocabulary
-->
 <xs:complexType name="Vocabulary">
  <xs:sequence>
   <xs:element ref="r2mlv:VocabularyEntry" maxOccurs="unbounded"/>
  </xs:sequence>
 </xs:complexType>
 <!--
VocabularyEntry
-->
 <xs:complexType name="VocabularyEntry">
  <xs:attribute ref="r2mlv:ID"/>
 </xs:complexType>
 <!--Predicate -->
 <xs:complexType name="Predicate">
  <xs:complexContent>
   <xs:extension base="r2mlv:VocabularyEntry">
    <xs:attribute name="predicateCategory" type="r2mlv:PredicateCategory" default="closed"/>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>
 <!--
Property
-->
 <xs:complexType name="Property">
  <xs:complexContent>
   <xs:extension base="r2mlv:Predicate">
    <xs:sequence>
     <xs:element ref="r2mlv:domain" minOccurs="0"/>
     <xs:element ref="r2mlv:range" minOccurs="0"/>
    </xs:sequence>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>
 <!--
Type
-->
 <xs:complexType name="Type">
  <xs:complexContent>
   <xs:extension base="r2mlv:VocabularyEntry"/>
  </xs:complexContent>
 </xs:complexType>
 <!-- 
DatatypePredicate
-->
 <xs:complexType name="DatatypePredicate">
  <xs:complexContent>
   <xs:extension base="r2mlv:Predicate">
    <xs:attribute ref="r2mlv:arity"/>
    <xs:attribute ref="r2mlv:vp" use="optional"/>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>
 <!--
Attribute
-->
 <xs:complexType name="Attribute">
  <xs:complexContent>
   <xs:extension base="r2mlv:Property">
    <xs:attribute ref="r2mlv:np" use="optional"/>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>
 <!--
ReferenceProperty
-->
 <xs:complexType name="ReferenceProperty">
  <xs:complexContent>
   <xs:extension base="r2mlv:Property">
    <xs:attribute ref="r2mlv:vp" use="optional"/>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>
 <!--
Class
-->
 <xs:complexType name="Class">
  <xs:complexContent>
   <xs:extension base="r2mlv:Type">
    <xs:sequence>
     <xs:element name="superClass" minOccurs="0">
      <xs:complexType>
       <xs:sequence>
        <xs:element ref="r2mlv:Class" maxOccurs="unbounded"/>
       </xs:sequence>
      </xs:complexType>
     </xs:element>
     <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="r2mlv:Attribute"/>
      <xs:element ref="r2mlv:ReferenceProperty"/>
     </xs:choice>
    </xs:sequence>
    <xs:attribute ref="r2mlv:np" use="optional"/>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>
 <!--
Datatype
-->
 <xs:complexType name="Datatype">
  <xs:complexContent>
   <xs:extension base="r2mlv:Type"/>
  </xs:complexContent>
 </xs:complexType>
 <!-- 
ObjectName
-->
 <xs:complexType name="ObjectName">
  <xs:complexContent>
   <xs:extension base="r2mlv:VocabularyEntry"/>
  </xs:complexContent>
 </xs:complexType>
 <!-- 
GenericEntityName
-->
 <xs:complexType name="GenericEntityName">
  <xs:complexContent>
   <xs:extension base="r2mlv:VocabularyEntry"/>
  </xs:complexContent>
 </xs:complexType>
 <!-- 
domain
-->
 <xs:complexType name="domain">
  <xs:sequence>
   <xs:element ref="r2mlv:Class"/>
  </xs:sequence>
  <xs:attribute ref="r2mlv:domrm" use="optional"/>
 </xs:complexType>
 <!-- 
range
-->
 <xs:complexType name="range">
  <xs:choice>
   <xs:element ref="r2mlv:Class"/>
   <xs:element ref="r2mlv:Datatype"/>
  </xs:choice>
  <xs:attribute ref="r2mlv:rgrn" use="optional"/>
 </xs:complexType>
 <!-- arguments -->
 <xs:complexType name="argumentsType">
  <xs:sequence>
   <xs:element ref="r2mlv:Type" maxOccurs="unbounded"/>
  </xs:sequence>
 </xs:complexType>
 <!--PredicateCategory-->
 <xs:simpleType name="PredicateCategory">
  <xs:restriction base="xs:string">
   <xs:enumeration value="closed"/>
   <xs:enumeration value="open"/>
   <xs:enumeration value="partial"/>
  </xs:restriction>
 </xs:simpleType>
 <!-- annotation elements -->
 <xs:complexType name="ap" abstract="false">
  <xs:complexContent>
   <xs:restriction base="xs:anyType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
     <xs:any  processContents="skip"/>
    </xs:sequence>
   </xs:restriction>
  </xs:complexContent>
 </xs:complexType>
 <!-- attributes -->
 <xs:attribute name="ID" type="xs:QName"/>
 <xs:attribute name="arity" type="xs:positiveInteger"/>
 <!-- properties for verbalization -->
 <xs:attribute name="np" type="xs:string"/>
 <xs:attribute name="vp" type="xs:string"/>
 <xs:attribute name="domrm" type="xs:string"/>
 <xs:attribute name="rgrn" type="xs:string"/>
</xs:schema>
